const Router = require('koa-router')
const { Success } = require('../../core/http-exception')
const { Auth } = require('../../core/middleware/auth')
const { Posts } = require('../../models/posts')
const router = new Router({
  prefix: '/v1/posts',
})
router.post('/releaseForm', new Auth().m, async (ctx, next) => {
  const obj = ctx.request.body
  const data = await Posts.releaseForm({
    ...obj,
    userid: ctx.auth.id
  })
  ctx.body = {
    code: 200,
    data: data,
  }
})
module.exports = router

